package com.study.kafka.consumer;

import com.study.kafka.message.Demo01Message;
import lombok.extern.slf4j.Slf4j;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * @author yuantongqin
 * 2021/8/3
 **/
//@Component
@Slf4j
public class Demo01Consumer {

    @KafkaListener(topics = {Demo01Message.TOPIC}, groupId = "demo01-consumer-group-" + Demo01Message.TOPIC)
    public void onMessage(Demo01Message message) {
        log.info("[onMessage][线程编号:{} 消息内容：{}]", Thread.currentThread().getId(), message);
    }

}
